UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1SBCx17fiGAPV7VW9kGsvT+f4DbHppB95YiRBTIc/Ew=' 
WHERE 
  key_id = 'b87666067da1e4b4bb91f90ef43e68152a283d6a64bc0a3b19c8b0fb92bbffe9' 
  AND (
    token = '1SBCx17fiGAPV7VW9kGsvT+f4DbHppB95YiRBTIc/Ew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029