UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wgm+sByTQWlbIC+qqHxTULZWw8TDI08JCEqhyEvdi5I=' 
WHERE 
  key_id = 'c5093ae33ecbdcaff5575c5b1fd7a9a4caffdd5dd0cb4ca665224c4867b85764' 
  AND (
    token = 'Wgm+sByTQWlbIC+qqHxTULZWw8TDI08JCEqhyEvdi5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031