UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sq2nQfrT6T8+7bdFueqsLhMPXyNwPO5dfVZpzNiaPSM=' 
WHERE 
  key_id = '15fd902a7ea9167a05b513f34cc3e5dd637fd3f6c3d279fb847664b407ccaebb' 
  AND (
    token = 'sq2nQfrT6T8+7bdFueqsLhMPXyNwPO5dfVZpzNiaPSM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017