UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p8y8JkNBqiNx8L1er+PxKvNZ9vK8BpZzUsyGbvT6L3I=' 
WHERE 
  key_id = 'd22b2168540f59a6d47e15ff7b3c926d15e0036aa2028a650d41934e2cd1b95d' 
  AND (
    token = 'p8y8JkNBqiNx8L1er+PxKvNZ9vK8BpZzUsyGbvT6L3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038