UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cEfcLaEvkDhQYmpQOf16b83NQLKC+H2Cbf3tQpO3Wz8=' 
WHERE 
  key_id = '25700effbcfc5b385fe5abc43b3a983829cf0cfce5951ebfffdf8c4c0041f90e' 
  AND (
    token = 'cEfcLaEvkDhQYmpQOf16b83NQLKC+H2Cbf3tQpO3Wz8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029