UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7xRX90iTs/YWAj1sp11o6dG0S7Fi9i3Mzcq7S1D77cQ=' 
WHERE 
  key_id = '4523dc51a964f2a053049fdfd776e166b0298db63b44c1b3db93780528ff0e7e' 
  AND (
    token = '7xRX90iTs/YWAj1sp11o6dG0S7Fi9i3Mzcq7S1D77cQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00070