UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zSVq+MYoyRc5FMvY3G1MQq6loP77Q6S1CdQI0Y1/Ud8=' 
WHERE 
  key_id = '1655aa1e42ec73e7ac209f28ab3e5e4959cf0cc46ac4884b952708582c618971' 
  AND (
    token = 'zSVq+MYoyRc5FMvY3G1MQq6loP77Q6S1CdQI0Y1/Ud8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038