UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nTnKtr7MRUOs43mr0JMW8vGhTvMNeocf0SX5b2L9hEM=' 
WHERE 
  key_id = '706a44746eb098ce4d6e2e7cb779c98c7ccb8170f3bea226b39bf3b3fab0de33' 
  AND (
    token = 'nTnKtr7MRUOs43mr0JMW8vGhTvMNeocf0SX5b2L9hEM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048