UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JYSXfZyEjnHE79ToVyfWyoYzX6gT73/47vfN0/2WFMY=' 
WHERE 
  key_id = '70103bc327f0866477610b24e157ae9f6037175cef8ef55f50483d8ec77c890b' 
  AND (
    token = 'JYSXfZyEjnHE79ToVyfWyoYzX6gT73/47vfN0/2WFMY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013