UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UTObhsC7wV94HT7zRRbH3mqftJkNkiivrH7utIrBV1Q=' 
WHERE 
  key_id = '9ab1d46ff39c0fe79e6c5031590604b5ce1a6f147fe4f39ff5e813341eb67c04' 
  AND (
    token = 'UTObhsC7wV94HT7zRRbH3mqftJkNkiivrH7utIrBV1Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041