UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uKf1ld9a3ER+1j9FuW6b7DZykgnJ3no598FoCDillZA=' 
WHERE 
  key_id = '826850fb94f06ff9c228e6ec7d7e5d859ca9937bd9c0acf478aab3fac4731162' 
  AND (
    token = 'uKf1ld9a3ER+1j9FuW6b7DZykgnJ3no598FoCDillZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049