UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gf9nchiagjYHUeQ4N3NLDXID9/ev3Ru5pOiwV2MW7dQ=' 
WHERE 
  key_id = '02567b701955ed38132c1477bce118f6d26d1d1b5bae4d92ec9bfe72f2d72229' 
  AND (
    token = 'Gf9nchiagjYHUeQ4N3NLDXID9/ev3Ru5pOiwV2MW7dQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025