UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LgJMiv9bUE6ng7e7W59aDzcOpOWhbN4n1SbFKQF7+2E=' 
WHERE 
  key_id = 'ff84dd998d47aa3a39a8d9047c76b857f31457714ee568f47db0c425e5bf5006' 
  AND (
    token = 'LgJMiv9bUE6ng7e7W59aDzcOpOWhbN4n1SbFKQF7+2E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033