UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tYMKjThXODi8tjjP8rx4lnSBtH0mh7gUNP9yLuHWLxA=' 
WHERE 
  key_id = '0b04169cb7c94d3a271064d835554fc39bdd06be2b27a1f70fe1ca3315580eeb' 
  AND (
    token = 'tYMKjThXODi8tjjP8rx4lnSBtH0mh7gUNP9yLuHWLxA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034