UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M0jMlKnVJJ1rzOMg3PjoelCuZ5/4Llxd9EBYaFBM/bQ=' 
WHERE 
  key_id = '225e189b5289fd7a6becdc19bf4024f866adb38ea6c8c8cdd817d89c8e9e6285' 
  AND (
    token = 'M0jMlKnVJJ1rzOMg3PjoelCuZ5/4Llxd9EBYaFBM/bQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050