UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+q6bS4uyvXNAi3+YFtFZRkjmFyrHfPgaBb9mRZqb8LE=' 
WHERE 
  key_id = 'a899f14bddf9340e7cee8d0425fd3d691e4f5d204c77c3dbd68759e9b67fd11e' 
  AND (
    token = '+q6bS4uyvXNAi3+YFtFZRkjmFyrHfPgaBb9mRZqb8LE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028