UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1j+jTaAwU7tv3oOwrQy46o2dv8+O7SH63op/PCUS2Mo=' 
WHERE 
  key_id = 'f5d9465b6e75e652348b361e37e64500ebc63662c0480a7821e1dd245e94e25c' 
  AND (
    token = '1j+jTaAwU7tv3oOwrQy46o2dv8+O7SH63op/PCUS2Mo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00070