UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tXYC+2q5zrTRPz62BBOw2NpdJ9XSzz7xgZ2l5dvCd00=' 
WHERE 
  key_id = 'fea267d17a0c1530c18d1d6044c0e0bc5d31527e719fb548bcb044889b1a3a0d' 
  AND (
    token = 'tXYC+2q5zrTRPz62BBOw2NpdJ9XSzz7xgZ2l5dvCd00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038