UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3gs1qjGVq7FLakcNvzLLY//3XfLisRpY/nMPqhb2sF0=' 
WHERE 
  key_id = '766f171bcb82531cba1c5560ccf83c0d52de95d13dfa006b2883d8fe7e573fbc' 
  AND (
    token = '3gs1qjGVq7FLakcNvzLLY//3XfLisRpY/nMPqhb2sF0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016