UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FTLdDwbk9ddw9RmCzVbujtd3d8H8gUjv1hw7zhqsQEA=' 
WHERE 
  key_id = 'cc491f0a7bc1501dd72ce3a5aade184e0056086d25c701c52c1fa3de2a88a26d' 
  AND (
    token = 'FTLdDwbk9ddw9RmCzVbujtd3d8H8gUjv1hw7zhqsQEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016