UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FSEU5yudnDT3p9BVWdZTlmugK6rxPwuWaa63Fp9L4hc=' 
WHERE 
  key_id = 'ad3834fc641d76d9bce54e17c4378be103ce70887fbdf2c67cd58682ff28e032' 
  AND (
    token = 'FSEU5yudnDT3p9BVWdZTlmugK6rxPwuWaa63Fp9L4hc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046