UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T3tfpyDDAAXwk9LM9rq4YvKmTMIMrxFjlzhzuEQSeNY=' 
WHERE 
  key_id = '81353a8c9add26ab0532424d2f8d33a38ca5e43e6d8d0061e44b3cfdae30434a' 
  AND (
    token = 'T3tfpyDDAAXwk9LM9rq4YvKmTMIMrxFjlzhzuEQSeNY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047