UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VD44MhYZLoqANf7WeRkj5/sUsWssnjuKXl0ykyKqNDo=' 
WHERE 
  key_id = '4d5cbdcacfdeeaaafce989dbb727f644a75c8521a68cd878f35b333093937b8b' 
  AND (
    token = 'VD44MhYZLoqANf7WeRkj5/sUsWssnjuKXl0ykyKqNDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022