UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B6JOTxAh1S9DgZQxQd0q2LaMqEieNMfGs5g5C6RzVYg=' 
WHERE 
  key_id = '5fd68092a7b5f268cc1bd0b0957c01116ce7b65ab359efb1ccd1b051efba608b' 
  AND (
    token = 'B6JOTxAh1S9DgZQxQd0q2LaMqEieNMfGs5g5C6RzVYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020