UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jmKAEcESjZBGmJ9U3iQS/jY9SKuow8a5MjImQgMra8A=' 
WHERE 
  key_id = 'c8e13f50020247a5062801716f6c5bdd4d1a2f7d3704d17b4f5542e6e4affd77' 
  AND (
    token = 'jmKAEcESjZBGmJ9U3iQS/jY9SKuow8a5MjImQgMra8A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041