UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4As4mHcI8S4tomrWFpF8ZlSZD4AN16/fABfFkCp5btk=' 
WHERE 
  key_id = '0072d64602fc24b920e61fc0ecc2c1740f8ef0cd6bcb268bef20b812ebe4c8c5' 
  AND (
    token = '4As4mHcI8S4tomrWFpF8ZlSZD4AN16/fABfFkCp5btk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034